package com.gj.xxl.job.core.handler;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class MethodJobHandler {

    //定时任务的方法对象
    private Method method;

    //执行定时任务方法的 bean 对象
    private Object target;

    public MethodJobHandler() {
    }

    public MethodJobHandler(Object target, Method method) {
        this.target = target;
        this.method = method;
    }

    public void invoke() throws InvocationTargetException, IllegalAccessException {

        method.invoke(target);

    }
}
